<template>
  <li class="card-item">
    <div class="card">
      <div class="img-wrap">
        <img :src="require(`../../../assets/img/${item.name}.jpg`)" :alt="item.name" />
      </div>
      <div class="mask">
        <h1>{{ item.name }}</h1>
        <h2>{{ item.state }}</h2>
      </div>
    </div>
  </li>
</template>

<script>
export default {
  name: "CardItem",
  props: {
    item: Object,
  },
};
</script>

<style lang="scss" scoped>
.card-item {
  width: 90%;
  margin: auto;
  position: relative;
  border: 1px solid #acacac;
  box-shadow: 10px 10px 5px #888888;
  margin-bottom: 20px;
  .img-wrap {
    height: 240px;
    img {
      height: 240px;
      width: 100%;
    }
  }
  .mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    text-align: center;
    background-color: #34343477;
    padding-top: 70px;
    h1 {
      color: red;
      font-size: 32px;
      font-weight: 600;
    }
    h2 {
      margin-top: 10px;
      font-size: 28px;
      color: #fff;
    }
  }
}
</style>
